<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>订单页面</title>
<link href="/css/common.css"
	rel="stylesheet" type="text/css" />
<link href="/css/cart.css"
	rel="stylesheet" type="text/css" />
<link href="/css/product.css"
	rel="stylesheet" type="text/css" />
	<!-- 新 Bootstrap4 核心 CSS 文件 -->
	<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">

	<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
	<script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>

	<!-- bootstrap.bundle.min.js 用于弹窗、提示、下拉菜单，包含了 popper.min.js -->
	<script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>

	<!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
	<script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>
	<div class="container header">
		<div class="span5">
			<div class="logo">
				<a> <img
					src="/image/r___________renleipic_01/logo.gif"
					alt="" />
				</a>
			</div>
		</div>
		<div class="span9">
			<div class="headerAd">
				<img src="/image/header.jpg"
					width="320" height="50" alt="正品保障" title="正品保障" />
			</div>
		</div>

	<!--	//插入主页-->
		<!--<%@ include file="menu.jsp"%>-->
	</div>
	<div class="container cart">
		<div class="span24">

			<div class="container">
				<table class="table table-hover">
					<h3 style="margin: 35px 360px">我的订单</h3>

					<thead>
					<tr>
						<th >订单ID</th>
						<th>用户名</th>
						<th>商品名</th>
						<th>数量</th>
						<th>价格</th>
						<th>订单状态</th>
						<th>交易时间</th>
					</tr>
					</thead>
					<tbody>
					<tr th:each="order:${page.getRecords()}">
						<td th:text="${order.getOrderId()}"/>
						<td th:text="${order.getUsers().getUsername()}" />
						<td th:text="${order.getGoods().getGoodsName()}"/>
						<td th:text="${order.getOrderGoodsNumber()}"/>
						<td th:text="${order.getOrderPrice()}"/>
						<td th:switch="${order.getOrderState()}">
							<a href="#" th:case="1">去支付</a>
							<span th:case="2">待发货
      </span>
							<span th:case="3">
      <a th:href="@{/buyer/modifyState(orderId=${order.getOrderId()},state=${4})}">确认收货</a>
      </span>
							<span th:case="4">订单完成/
        <a th:href="@{/buyer/modifyState(orderId=${order.getOrderId()},state=${5})}" >申请退款</a>/
        <a th:href="@{/buyer/modifyState(orderId=${order.getOrderId()},state=${0})}">删除订单</a>
      </span>
							<span th:case="5">退款中</span>
							<span th:case="6">已退款/
      <a th:href="@{/buyer/modifyState(orderId=${order.getOrderId()},state=${0})}">删除</a>
      </span>
							<span th:case="7">订单完成/
       <a th:href="@{/buyer/modifyState(orderId=${order.getOrderId()},state=${5})}" >申请退款</a>/
        <a th:href="@{/buyer/modifyState(orderId=${order.getOrderId()},state=${0})}">删除订单</a>
      </span>
							<span th:case="8">拒绝退款/
       <a href="" >申诉</a>/
        <a th:href="@{/buyer/modifyState(orderId=${order.getOrderId()},state=${0})}">删除订单</a>
      </span>
						</td>
						<td th:text="${order.getOrderCreateTime()}"/>
					</tr>

					</tbody>
				</table>
			</div>
			<ul class="pagination" style="margin: 35px 360px">
				<li class="page-item"><a class="page-link" th:href="@{/buyer/orderList(index=${page.getCurrent()-1})}">上一页</a></li>
				<li class="page-item">
				<a class="page-link" th:href="@{/buyer/orderList(index=${i})}"  th:each="i :${#numbers.sequence(1, 1)}" th:text="  ${i}"   ></a>
				</li>
				<li class="page-item"><a class="page-link" th:href="@{/buyer/orderList(index=${page.getCurrent()+1})}">下一页</a></li>
			</ul>
		</div>

	</div>
	<div class="container footer" style="margin: 18%">
		<div class="span24">
			<div class="footerAd">
				<img src="/image/r___________renleipic_01/footer.jpg" alt="我们的优势"
					title="我们的优势" height="52" width="950">
			</div>
		</div>
		<div class="span24">
			<ul class="bottomNav">
				<li><hr></hr></li>
			</ul>
		</div>
		<div class="span24">
			<div class="copyright">Copyright ©  网上商城 版权所有</div>
		</div>
	</div>
</body>
</html>